﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MDF.Worker;

namespace TGVR_Boot.Workers
{
    public class SearchTicketWorker : IWorker
    {
        private string m_strStationForm;
        private string m_strStationTo;
        private DateTime m_dtDateFrom;
        private DateTime? m_dtDataTo;
        private int m_iAdut;
        private int m_iChild;
        private int m_iBaby;
        private IBoot m_SearchEngine;
        private bool m_isInter;
        private int m_iUserID;

        public SearchTicketWorker(string strName, IBoot SearchEngine, onWorkerDoneHandler onDoneEvent, string _strStationForm, string _strStationTo, DateTime _dtDateFrom, DateTime? _dtDataTo,
            int _iAdut, int _iChild, int _iBaby, bool _isInter, int _iUserID)
        {
            this.m_strStationForm = _strStationForm;
            this.m_strStationTo = _strStationTo;
            this.m_dtDateFrom = _dtDateFrom;
            this.m_dtDataTo = _dtDataTo;
            this.m_iAdut = _iAdut;
            this.m_iChild = _iChild;
            this.m_iBaby = _iBaby;
            this.m_SearchEngine = SearchEngine;
            this.onDoneEvent = onDoneEvent;
            this.WorkerName = strName;
            this.m_isInter = _isInter;
            this.m_iUserID = _iUserID;
        }
        protected override object DoIt()
        {
            var obj = m_SearchEngine.Search( m_strStationForm,  m_strStationTo,  m_dtDateFrom,  m_dtDataTo,
             m_iAdut, m_iChild, m_iBaby, m_isInter, m_iUserID);
            return obj;
        }
    }
}
